﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.ObjectBuilder2;

namespace IoCNamed.UnityNameResolver
{
    internal class ResolveNamePolicyDelegated : IResolveNamePolicy
    {
        protected readonly NameResolverDelegate Resolver;

        public ResolveNamePolicyDelegated(NameResolverDelegate resolver)
            : base()
        {
            Resolver = resolver;
        }

        public string ResolveName(NamedTypeBuildKey buildKey)
        {
            return Resolver(buildKey.Type);
        }
    }
}
